import * as vscode from 'vscode';
export function activate(context: vscode.ExtensionContext) {

    // 监听文档修改事件
    const changeSubscription = vscode.workspace.onDidChangeTextDocument(e => {
        if (e.document.isDirty) {
            vscode.window.showInformationMessage('文档被修改了');
        }
    });

    // 监听文档保存事件
    const saveSubscription = vscode.workspace.onDidSaveTextDocument(doc => {
        vscode.window.showInformationMessage('文档被保存了');
    });

    context.subscriptions.push(changeSubscription, saveSubscription);
}